

import React from 'react';
import {Switch,Redirect,Route} from 'react-router-dom'
const Routerview = (props) => {
    const {router}=props
    return (
        <Switch>
               {
                    router.length>0&&router.map((v,i)=>{
                       return (
                        v.path ?<Route key={i} path={v.path} render={props=><v.component {...props} router={v.children}></v.component>}></Route>
                        :<Redirect key={i} {...v}></Redirect>
                       )
                    })
                }
            </Switch>
    );
}

export default Routerview;

